package com.sunwayhorizo.health.business.registries.threelevels;

import java.util.List;

import javax.ejb.Local;

import com.sunwayhorizo.health.business.base.IBaseManager;
import com.sunwayhorizo.health.business.dto.ResultsDTO;
import com.sunwayhorizo.health.business.dto.registries.MedicalTeamDTO;
import com.sunwayhorizo.health.business.dto.registries.ThreeLevelsPhysicianDTO;
import com.sunwayhorizo.health.hl7.common.Hl7Exception;
import com.sunwayhorizo.health.hl7.rim.Act;

@Local
public interface ThreeLevelsPhysicianManagerLocal extends IBaseManager {

	/**
	 * 新增医疗组、三级医师
	 * 医疗组为必填，三级医生可以不维护
	 * @param dto
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO newThreeLevelsPhysician( MedicalTeamDTO  dto)throws Hl7Exception;
	
	/**
	 * 修改三级医师
	 * @param dto
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO updateThreeLevelsPhysician(MedicalTeamDTO dto )throws Hl7Exception;
	
	/**
	 * 删除三级医师
	 * @param list 经治医生id集合
	 * @return
	 * @throws Hl7Exception
	 */
	@SuppressWarnings("rawtypes")
	public ResultsDTO delThreeLevelsPhysician(List list) throws Hl7Exception;
	
	/**
	 * 删除医疗组信息，如果该医疗组下面有三级医生关系的时候，不能删除
	 * @param list 医疗组id集合
	 * @return
	 * @throws Hl7Exception
	 */
	@SuppressWarnings("rawtypes")
	public ResultsDTO delMedicalTeam(List list) throws Hl7Exception;
	
	/**
	 * 根据工作组查询三级医师
	 * @param workgroupId
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO findThreeLevelsPhysicianList(String workgroupId)throws Hl7Exception;
	
	/**
	 * 验证医疗组编码是否存在
	 * @param code
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO validateThreeLevelsCode(String code) throws Hl7Exception;
	

	/**
	 * 根据经治医生查询上级，主任医生
	 * 该查询得到的上级主任医生没有跟患者进行关联，是出厂默认的医疗组三级医生
	 * @param doctId
	 * @return
	 * @throws Hl7Exception
	 */
	public ThreeLevelsPhysicianDTO findThreeLevelsDTOByDoctId(String doctId) throws Hl7Exception;
	
	
	/**
	 * 跟患者关联的三级医生关系修改
	 * 当经治医生需要修改的时候，患者直接制定给另外的三级医生组
	 * @param threeLevel
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO modfiyThreeLevelByPatient(ThreeLevelsPhysicianDTO threeLevel) throws Hl7Exception;
	
	/**
	 * 根据患者id查询患者的三级医生
	 * @param patientId
	 * @return
	 * @throws Hl7Exception
	 */
	public ThreeLevelsPhysicianDTO findThreeLevelsDTOByPatienId(String patientId) throws Hl7Exception;
}
